/*
* Copyright (C) 2009-2010 - Roman Kalynchuk
*
* This file is part of REngine.
*
* REngine is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* REngine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with REngine.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef __CVERTEXBUFER_SDL_H__
#define __CVERTEXBUFER_SDL_H__

#include "render/ivertexbuffer.h"

namespace rengine3d {

	class CVertexBufferSDL: public IVertexBuffer {
	public:
		CVertexBufferSDL(IRenderDriver* renderDriver, uint flags, vbDrawType_t drawType, vbUsageType_t usageType, uint vertexNum = 0, uint indexNum = 0);
		virtual ~CVertexBufferSDL();

		virtual void AddVertex(const CVec3& vertex, uint flags);
		virtual void AddColor(const CVec4& color, uint flags);
		virtual void AddIndex(uint index);

		virtual void Compile(uint flags);
		virtual void Transform(const CMat4& transformMatrix);

		virtual void Draw(vbDrawType_t drawType = vbDrawType_Default );
		virtual void DrawIndices(uint* indices, uint count, vbDrawType_t drawType = vbDrawType_Default );

		virtual void SetVertexStates(uint flags) ;

		virtual void Bind(void);
		virtual void UnBind(void);

		virtual float* GetArray(uint arrayType);
		virtual uint* GetIndexArray();

		virtual uint GetVertexNum(void);
		virtual uint GetIndexNum(void);
	private:
		floatVector_t m_vertexArray[vbNumVertexFlags];
		uintVector_t  m_indexArray;

	};
}

#endif
